<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="/template.xhtml">
	<ui:define name="corpo">
		<h:form id="senhaForm">
			<h2>Alteração de senha</h2>
			<p:growl id="growl" life="2500"></p:growl>
			<p:messages id="a"></p:messages>

			<h:panelGrid id="panelAltera" columns="3" cellpadding="4"
				style="margin:0 auto;">

				<h:outputLabel value="Senha atual:" for="txtSenhaAtual" />
				<p:password id="txtSenhaAtual" value="#{loginBean.usuario.senha}" />
				<p:message id="msSenhaAtual" for="txtSenhaAtual"></p:message>

				<h:outputLabel value="Nova senha:" for="txtSenhaNova" />
				<p:password id="txtSenhaNova" value="#{loginBean.senhaNova}" />
				<p:message id="msSenhaNova" for="txtSenhaNova"></p:message>


				<h:outputLabel value="Confirma nova Senha:"
					for="txtConfirmaSenhaNova" />
				<p:password id="txtConfirmaSenhaNova"
					value="#{loginBean.confirmaSenhaNova}" />
				<p:message id="msConfirmaSenhaNova" for="txtConfirmaSenhaNova"></p:message>

				<h:outputText></h:outputText>
				<p:column colspan="1">
					<p:commandButton value="Salvar"
						actionListener="#{loginBean.alteraSenha}"
						update="a msSenhaAtual msConfirmaSenhaNova msSenhaNova" />
					<p:commandButton type="reset" value="Limpar"></p:commandButton>
				</p:column>

			</h:panelGrid>

		</h:form>
	</ui:define>
</ui:composition>
</html>